package qiuzhao;

import java.util.Arrays;
import java.util.Scanner;

public class MT {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), k = in.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = in.nextInt();
        }
        if (n == 1) {
            System.out.println(k);
            return;
        }
        Arrays.sort(arr);
        int[] tmp = new int[n - 1]; // 存放arr中相邻位置的差
        for (int i = 0; i < n - 1; i++) {
            tmp[i] = arr[i + 1] - arr[i];
        }
        // 二分查找，最终结果在区间[k/n + k%n == 0 ? 1 : 0, k]
        int left = k / n + (k % n == 0 ? 1 : 0);
        int right = k;
        while (left < right) {
            int count = 0;
            int mid = (left + right) / 2;
            for (int i = 0; i < tmp.length; i++) {
                count += Math.min(tmp[i], mid);
                if (count >= k) {
                    break;
                }
            }
            count += mid;
            if (count >= k) {
                right = mid;
            } else {
                left = mid + 1;
            }
        }
        System.out.println(left);
    }
}
